package com.bawei.movie.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bawei.movie.dao.MovieMapper;
import com.bawei.movie.domain.Movie;
import com.bawei.movie.service.IMovieService;

/**
 * 影片业务处理服务实现
 * @author zhaoming.li
 *
 */
@Service
public class MovieServiceImpl extends ServiceImpl<MovieMapper, Movie> implements IMovieService {
	@Override
	public boolean handleMovieStatusById(Integer id, String status) {
		boolean result = false;
		
		Movie movie = new Movie();
		movie.setId(id);
		if ("正在热映".equals(status)) {			
			movie.setStatus("已经下架");
		} else if("已经下架".equals(status)){
			movie.setStatus("正在热映");
		}
		result = updateById(movie);
		
		return result;
	}
}
